//
// Created by MikeChen on 2025/4/3.
//


#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {
    char str1[128] = "Hello";
    char str2[128] = "Hello";

    //字符串 输出函数
//    puts(str1);
    //字符串 输入函数
//    gets(str1);
//    puts(str1);

    //strlen 计算字符串长度函数，只计算有效字符，不包括'\0'
    /*printf("strlen:%lu\n", strlen(str1));//strlen:5
    printf("sizeof:%lu\n", sizeof (str1));//sizeof:128*/

    //计算
    int count = 0;
    char *pStr = str1;
    while (*pStr != '\0') {
        count++;
        *pStr++;
    }
    printf("自定义strl大小:%d\n", count);//strlen:5
    printf("strlen(str1)大小:%lu\n", strlen(str1));//sizeof:128*

//    system("read -rsp $'Press enter to continue...\\n'");
    return EXIT_SUCCESS;
}